package com.best.onegous.Adapter;



import java.util.ArrayList;
import java.util.List;

import com.best.onegous.R;
import com.best.onegous.View.MyDialog;
import com.best.onegous.details.User;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;

import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

public class NewsAdapter extends BaseAdapter{
	Intent intent;
	  private List<String> data = new ArrayList<String>();  
	    private LayoutInflater layoutInflater;  
	    private Context context;  
	    public NewsAdapter(Context context, List<String> data) {  
	        this.context = context;  
	        this.data = data;  
	        this.layoutInflater = LayoutInflater.from(context);  
	    }     
	@Override
	public int getCount() {
		// TODO Auto-generated method stub

		return data.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub

		return data.get(position);
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return position;
	}


	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
			ViewHome viewhome=null;
			if(convertView==null){
				viewhome = new ViewHome();
				convertView = layoutInflater.inflate(R.layout.news_item, null);
			//	viewhome.jiesan = (Button) convertView.findViewById(R.id.jiesan);
				//viewhome.item = (LinearLayout) convertView.findViewById(R.id.item);
				//viewhome.title = (TextView) convertView.findViewById(R.id.title);
				convertView.setTag(viewhome);
			}else{
				viewhome = (ViewHome) convertView.getTag();
			}
		
			return convertView;
		}
	 class ViewHome{  
		 private Button jiesan;
		 
		    private LinearLayout item;
		    private TextView title;
		    
		}
		
	}